# @summary A short summary of the purpose of this class
#
# A description of what this class does
#
# @example
#   include csns::slurm::install
class csns::slurm::install (
	$dgnfs = false
){
        
	$glusterpkg=[
		'pcs',
		'rsync',
		'dbench',
		'git',
		'yajl',
		'expect',
		'vim-enhanced',
		'gcc',
		'gcc-c++',
		'bison',
		'flex',
		'libtool',
		'libxml2-devel',
		'libaio-devel',
		'libacl-devel',
		'python-devel',
		'userspace-rcu-devel',
		'libuuid-devel',
		'sqlite-devel',
		'lvm2-devel',
		'fuse-devel',
		'libibverbs-devel',
		'librdmacm-devel',
		'attr',
#		'rpcbind',
#		'nfs-utils',
		'glusterfs-client-xlators',
		'glusterfs-fuse',
		'glusterfs-libs',
		'glusterfs-api',
		'python-gluster',
		'glusterfs',
	]
	
	$slurmpkg=[
#		'mariadb-server',
#		'mariadb-devel',
		'perl-Switch',
		'openssl',
		'openssl-devel',
		'pam-devel',
		'numactl',
		'numactl-devel',
		'hwloc',
		'hwloc-devel',
		'lua',
		'lua-devel',
		'readline-devel',
		'rrdtool-devel',
		'ncurses-devel',
		'man2html',
		'libibmad',
		'libibumad',
		'slurm-slurmdbd',
		'slurm-openlava',
		'slurm-libpmi',
		'slurm-contribs',
		'slurm-example-configs',
		'slurm',
		'slurm-pam_slurm',
		'slurm-perlapi',
		'slurm-slurmd',
		'slurm-slurmctld',
		'slurm-devel',
		'slurm-torque',
	]	
      
        if ($dgnfs == true) {
		 package {['rpcbind','nfs-utils']:
                       ensure=> "installed",
			require => Yumrepo['csnspuppet'],
	
		} 
        }
#gluster abandon
#	package { $glusterpkg:
#		ensure => "installed",
#		require => Yumrepo['csnspuppet'],
#	}
	
	package { $slurmpkg:
		ensure => "installed",
		require => Yumrepo['csnspuppet'],
	}

	yumrepo { 'csnspuppet':
		baseurl  => "http://mirror.csns.ihep.ac.cn/csnspuppet/package/\$releasever/\$basearch",
		descr    => "csnspuppet",
		enabled  => 1,
		gpgcheck => 0,
		priority => 20,
		before   => Yumrepo['site'],

	}
}
